package io.hepu.robotize.util;

import javax.servlet.http.HttpServletRequest;

public class Requests {

    private Requests(){ throw new AssertionError("No Requests instances for you!"); }

    public static <T> T get(HttpServletRequest request, String name, Class<T> clazz) {
        Object attribute = request.getAttribute(name);
        return Jacksons.convert(attribute, clazz);
    }

    public static <T> void set(HttpServletRequest request, String name, T value) {
        request.setAttribute(name, value);
    }

}
